Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

eth, eth/tracers: expose gas used in tx to js tracer #22038

Merged
merged 7 commits into from
Dec 27, 2020

Conversation

s1na
Copy link
Contributor

@s1na s1na commented Dec 18, 2020

This PR replaces #21553 (fixes #20537). It exposes two new parameters gasPrice and intrinsicGas to js tracers. Using these two and the already exposed gasUsed they can calculate how much the sender spent on gas.

gballet and others added 5 commits December 18, 2020 13:31
eth/tracers: include tx gas in tracers usedGas

eth/tracers: fix prestate tracer's sender balance

eth/tracers: rm unnecessary import

eth/tracers: pass intrinsicGas separately to tracer

eth/tracers: fix tests broken by lack of txdata

eth, eth/tracers: minor fix
Copy link
Contributor

@holiman holiman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM -- I pushed a commit to un-export the struct used in testing, and also added a testcase for some basic sanity-checking of the feature.

Strikes me now though that the tests can be simplified even more...

@holiman
Copy link
Contributor

holiman commented Dec 21, 2020

Pushed another commit to remove some of the boilerplate

@holiman
Copy link
Contributor

holiman commented Dec 21, 2020

Ok, perfection achieved
Screenshot_2020-12-21 eth, eth tracers expose gas used in tx to js tracer by s1na · Pull Request #22038 · ethereum go-ether

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PrestateTracer returns wrong balance for tx sender
3 participants